package com.foodchain.controller;

import com.foodchain.entity.ActivityOuts;
import com.foodchain.service.ActivityOutsService;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.List;

/**
 * @ClassName 活动赛况
 * @Description TODO
 * @Author duyuanyuan
 * @Date 2019/3/19 15:22
 * @Version 1.0
 **/
@Controller
@RequestMapping("/outs")
public class ActivityOutsController extends BaseController{
    @Resource
    private ActivityOutsService activityOutsService;

    /*
     * 功能描述:查询活动赛况信息
     * @param:  * @param page
     * @param size
     * @return: java.lang.String
     * @auther: duyuanyuan
     * @date: 2019/3/27 17:25
     */
    @RequestMapping("/list")
    @ResponseBody
    public String list(@RequestParam(value = "page", defaultValue = "0") Integer page,
                       @RequestParam(value = "size", defaultValue = "10") Integer size){
        Page<ActivityOuts> outs = activityOutsService.findAll(page,size);
        return JsonCode(0,"success",outs);
    }

}
